/**
 * 
 */
package ccrClasses.layer2;

import ccrClasses.ICcr;

/**
 * @author matheus
 *
 */
public class Description implements ICcr{
	
	public static String OPEN_TAG = "<Description>";

	public static String CLOSE_TAG = "</Description>";
	
	private Text text;
	
	private Code code;

	public Description(Text text, Code code) {
		super();
		this.text = text;
		this.code = code;
	}
	
	public Description(Text text) {
		super();
		this.text = text;
		
	}

	public Description() {
		super();
	}

	/**
	 * @return the text
	 */
	public Text getText() {
		return text;
	}

	/**
	 * @param text the text to set
	 */
	public void setText(Text text) {
		this.text = text;
	}

	/**
	 * @return the code
	 */
	public Code getCode() {
		return code;
	}

	/**
	 * @param code the code to set
	 */
	public void setCode(Code code) {
		this.code = code;
	}

	/**
	 * @return the oPEN_TAG
	 */
	public String getOPEN_TAG() {
		return OPEN_TAG;
	}

	/**
	 * @return the cLOSE_TAG
	 */
	public String getCLOSE_TAG() {
		return CLOSE_TAG;
	}

	@Override
	public String constructCcrString() {
		String ccrDesc = OPEN_TAG;
		if(text != null){
			ccrDesc = ccrDesc + text.constructCcrString();
		}
		
		if(code != null){
			ccrDesc = ccrDesc + code.constructCcrString();
		}
		
		ccrDesc = ccrDesc + CLOSE_TAG;
		
		return ccrDesc;
	}
	
	

}
